#ifndef _RPC_SYSMGR_H_
#define _RPC_SYSMGR_H_

#include "rpc_fwd.h"

#pragma once

class RPCSysMgr : public AppBase
{
private:
    RPCSysMgr();
    virtual ~RPCSysMgr() throw();
public:
    virtual int32_t app_init();
    virtual void app_stop();
    virtual void app_reload();
    virtual const char * app_name() const;
    virtual AppModuleBase * find_module( int32_t module_id ) const;
    virtual int32_t app_run();

    static RPCSysMgr * init_rpcsys_instance();
    static void fini_rpcsys_instance();

private:
    int32_t init_rpcclient();

private:
    typedef RBTree< int32_t, AppModuleBase* > MODULETREE_T;
    MODULETREE_T              m_modulemgr;
    mutable Thread_RW_Mutex * m_mutex;
};

extern RPCSysMgr * g_rpcsysmgr;

#endif // _RPC_SYSMGR_H_


